/*
 * B.cpp
 *
 *  Created on: 2012-5-30
 *      Author: ncrd
 */


#include <cstdio>

int main (void) {
	int n;
	scanf("%d", &n);
	while (n--) {
		int i, j, sum = 0;
		scanf("%d", &i);
		sum = sum - i + 1;
		while (i--) {
			scanf("%d", &j);
			sum +=j;
		}
		printf("%d\n", sum);
	}
}
